#pragma once
#include "Color.h"
#include "dataTypes.h"

class TileDrawer{
public:
	TileDrawer(int aTileSize) : _tileSize(aTileSize), s(_tileSize){
		buffer = al_create_bitmap(s,s);
	};
	~TileDrawer(){
		al_destroy_bitmap(buffer);
	};

	// Technical
	void mixBitmaps(ALLEGRO_BITMAP* aImg, ALLEGRO_BITMAP* aMask, ALLEGRO_BITMAP* aMask2);

	// Uniform
	void drawBiome(int aLower);
	void drawTree(int aLower);
	void drawRoad(bool aConnections[4], int aRoadSize = 0);
	void drawRoadEdge(int aX1, int aY1, int aX2, int aY2, int aDir);

	// World map
	void drawRiver(bool aConnections[4], bool aConf = false);
	void drawRiverCoast(int aX1, int aY1, int aX2, int aY2, int aDir);
	void drawBridge(bool aV);
	void drawConfluence(int aDir);
	void drawMountain(int aLower);
	void drawCity(int aLower);
	void drawPort(bool aConnections[4]);

	// City map
	void drawWall(bool aConnections[4], int aBiome);
	void drawWoodenFloor();
	void drawCarpetFloor();
	void drawMarketFloor();
	void drawTempleFloor();
		void drawCubePattern(int aX, int aY);
	void drawBed(bool aBegin, int aDir);
		void drawBedSide(int aY);
	void drawOven(bool aBegin, int aDir);
	void drawBookcase(bool aBegin, int aDir);
	void drawFurnace(bool aBegin, int aDir);
	void drawHerbstand(bool aBegin, int aDir);
	void drawReception(bool aBegin, int aDir);
	void drawAltar(bool aCenter, int aDir);
	void drawTable(bool aChair = false);
	void drawWardrobe(int aDir);
	void drawBarrel();
	void drawCrate();
	void drawChest();
	void drawBucket();
	void drawAnvil();
	void drawPot();
	void drawBench(bool aVert);
	void drawCandlestick();
		void drawCandle(int aX, int aY);
	void drawPlant();
		void drawSign();
		void drawWeaponIcon();
		void drawArmorIcon();
		void drawHerbsIcon();
		void drawInnIcon();
	void drawSignWeapon();
	void drawSignArmor();
	void drawSignHerbs();
	void drawSignInn();
	void drawGrave();
	void drawFence(bool aConnections[4]);
	void drawWell();
	void drawMarketStand();
	void drawThrone(int aDir);
	void drawArmor();

	// Maze
	void drawTorch();
	void drawLadder();

	int _tileSize;
private:
	int& s;
	Color color;

	ALLEGRO_BITMAP* buffer;
};

